#include<iostream>
using namespace std;
void Resort(int* arr, int n)
{
	if (arr == NULL || n <= 0) {
		return;
	}
	int l = 0;
	int r = n - 1;
	while (l < r) {
		while (l < r && arr[l] % 2 == 1) {
			l++;
		}
		while (l < r && arr[r] % 2 == 0) {
			r--;
		}
		if (l < r) {
			swap(arr[l], arr[r]);
		}
	}
}
int main()
{
	//int arr[] = { 1,5,35,7,8,6,4,3,12,43,56 };
	int arr[] = { NULL };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Resort(arr, sz);
	for (int i = 0; i < sz; ++i) {
		cout << arr[i] << " ";
	}
	return 0;
}